package com.zzptc.sky.bdsjws.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.zzptc.sky.bdsjws.vo.Bbx;
import com.zzptc.sky.bdsjws.vo.Contact;
import com.zzptc.sky.bdsjws.vo.User;

import com.zzptc.sky.bdsjws.db.BbxDao;
import com.zzptc.sky.bdsjws.db.ContactDao;
import com.zzptc.sky.bdsjws.db.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig bbxDaoConfig;
    private final DaoConfig contactDaoConfig;
    private final DaoConfig userDaoConfig;

    private final BbxDao bbxDao;
    private final ContactDao contactDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        bbxDaoConfig = daoConfigMap.get(BbxDao.class).clone();
        bbxDaoConfig.initIdentityScope(type);

        contactDaoConfig = daoConfigMap.get(ContactDao.class).clone();
        contactDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        bbxDao = new BbxDao(bbxDaoConfig, this);
        contactDao = new ContactDao(contactDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(Bbx.class, bbxDao);
        registerDao(Contact.class, contactDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        bbxDaoConfig.clearIdentityScope();
        contactDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public BbxDao getBbxDao() {
        return bbxDao;
    }

    public ContactDao getContactDao() {
        return contactDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
